package com.qf.springMVCDemo01.controller;

import com.qf.springMVCDemo01.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author 刘欣
 * @createTime 2023/1/3 22:05
 * @description
 */
@Controller
@RequestMapping("/user")
public class UserController {
    @RequestMapping("/add")
    public String add(User user) {
        System.out.println(user);
        return "redirect:/user/select";
    }

    @RequestMapping("/del")
    public String del(Integer id) {
        System.out.println(id);
        return "redirect:/user/select";
    }

    @RequestMapping("/listUser")
    public String listUser() {
        return "forward:/view/user.html";
    }

    @RequestMapping("/select")
    public String select() {
        System.out.println("用户查询接口");
        return "/index.html";
    }
}
